Next Steps
Part 2, Chapter 19
We've covered a lot in this course. Take a few minutes to step back and reflect on what you've learned. Ask yourself the following questions:
- What were my objectives?
- How far did I get? How much is left?
- How was the process? Am I on the right track?
Objectives:
- Develop an asynchronous RESTful API with Python and FastAPI
- Practice Test-Driven Development
- Test a FastAPI app with pytest
- Interact with a Postgres database asynchronously
- Containerize FastAPI and Postgres inside a Docker container
- Run unit and integration tests with code coverage inside a Docker container
- Check your code for any code quality issues via a linter
- Configure GitHub Actions for continuous integration and deployment
- Use GitHub Packages to store Docker Images
- Speed up a Docker-based CI build with Docker Cache
- Deploy FastAPI, Uvicorn, and Postgres to Heroku with Docker
- Parameterize test functions and mock functionality in tests with pytest
- Run tests in parallel with pytest-xdist
- Document a RESTful API with Swagger/OpenAPI
- Run a background process outside the request/response flow
Now it's your turn! Spend some time refactoring and dealing with tech debt on your own.
Some ideas:
- Test coverage: Add more tests to increase the overall test coverage.
- DRY out the code: There's plenty of places in the code base that could be refactored.
- CORS Middleware: Use CORSMiddleware to handle cross-origin requests -- e.g., requests that originate from a different protocol, IP address, domain name, or port to prevent CORS-based attacks.
- Security Vulnerability Scanners: Along with checking for code quality and style, linters can also be used for finding security vulnerabilities. Scan your-
- Third-Party Extensions: Try out some of the extensions from the Awesome FastAPI repo. Can't find what you need? Write your own!
Be sure to check out our advanced FastAPI courses as well:
✓ Mark as Completed